<template>
	<view class="all">
		<u-swiper :list="swiperList" height="300">
		</u-swiper>
		<view class="center">
			<view class="one">
				<view class="left">
					<view class="s1">
						团购价格：
					</view>
					<view class="s2">
						￥39
					</view>
				</view>
				<image class="right" src="../../../static/user/shareIcon.png" @click="showshare=true"></image>
			</view>
			<view class="two">
				商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称
			</view>
			<view class="three">
				销量：100
			</view>
			<view class="four">
				<view class="top">
					<view>
						团购价:39
					</view>
					<view>
						上交价:26
					</view>
					<view>
						价差:13
					</view>
				</view>
				<view class="top">
					<view>
						推广费:39
					</view>
					<view>
						单量:26
					</view>
					<view>
						库存:13
					</view>
				</view>
			</view>
			<view class="solid">
			</view>
			<view class="five flex_sp" @click="show=true">
				<view class="flex">
					<view class="left">
						选择
					</view>
					<input type="text" placeholder="请选择规格" />
				</view>
				<image class="right" src="../../../static/rightback.png" mode=""></image>
			</view>
			<view class="solid">
			</view>
			<view class="shopdetil">
				<view class="top">
					商品评价
				</view>
				<view class="lists flex">
					<view class="list" v-for="(item , index) in infolist" :key="index">
						{{item}}
					</view>
				</view>
				<view class="card" v-for="(item , index) in 2" :key="index">
					<view class="flex">
						<image class="img1" src="../../../static/logo.png" mode=""></image>
						<view class="user">
							<view>
								名字
							</view>
							<u-rate :count="count" v-model="value"></u-rate>
						</view>
					</view>
					<view class="mesg">
						内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容
					</view>
					<view class="guige">
						规格
					</view>
				</view>
				<view class="allmsg" @click="goallmsg()">
					查看全部评价
				</view>
			</view>
			<view class="detil">
				<view class="tit">
					商品详情
				</view>
				<image src="../../../static/databg.png" mode=""></image>
			</view>
		</view>
		<view class="lastcard">
			<view class="left flex">
				<view>
					<image class="img1" src="../../../static/user/kfIcon.png" mode=""></image>
					<view>
						客服
					</view>
				</view>
				<view>
					<image class="img1" src="../../../static/user/scIcon.png" mode=""></image>
					<view>
						收藏
					</view>
				</view>
				<view>
					<image class="img1" src="../../../static/user/shopCarIcon.png" mode=""></image>
					<view>
						购物车
					</view>
				</view>


			</view>
			<view class="right">
				<view class="join" @click="show=true">
					加入购物车
				</view>
				<view class="buy" @click="show=true">
					立即购买
				</view>
			</view>
		</view>
		<!-- 规格弹窗 -->
		<u-popup :show="show" @close="show=false" :closeOnClickOverlay="true" :closeable="true" round="10">
			<view class="pop">
				<view class="top flex">
					<image class="img1" src="../../../static/logo.png" mode=""></image>
					<view>
						<view class="price">
							￥100`200.00
						</view>
						<view class="num">
							库存：999
						</view>
					</view>
				</view>
				<view class="center">
					<view class="tit">
						规格名称
					</view>
					<view class="lists flex">
						<view class="list" v-for="(item , index) in 8" :key="index">
							规格
						</view>
					</view>
					<view class="shopnum flex_sp">
						<view>
							数量
						</view>
						<u-number-box v-model="value2"></u-number-box>
					</view>
				</view>
				<view class="buttom" @click="surebuy()">
					确认
				</view>
			</view>
		</u-popup>
		<!-- 分享弹窗 -->
		<u-popup :show="showshare" @close="showshare=false" :closeOnClickOverlay="true" :closeable="true" round="10">
			<view class="share">
				<view class="top">
					分享至
				</view>
				<view class="center2">
					<view>
						<image src="../../../static/user/wxIcon.png" mode=""></image>
						<view>
							微信好友
						</view>
					</view>
					<view>
						<image src="../../../static/user/frendIcon.png" mode=""></image>
						<view>
							微信朋友圈
						</view>
					</view>
				</view>
				<view class="lastbut" @click="showshare=false">
					取消
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				swiperList: ['https://cdn.uviewui.com/uview/swiper/swiper3.png',
					'https://cdn.uviewui.com/uview/swiper/swiper2.png',
					'https://cdn.uviewui.com/uview/swiper/swiper1.png',
				],
				infolist: ['好评', '中评', '差评', '有图'],
				count: 5, //初始化评分数量
				value: 2, //评分
				value2: 1, //商品数量
				show: false, //规格弹窗
				list: {},
				showshare: false
			}
		},
		onLoad(option) {
			this.id = option.id
			// this.getdetil()
		},
		methods: {
			//获取详情
			async getdetil() {
				const res = await this.$api("/Index/read", 'get', {
					id: this.id
				}).then((res) => {
					console.log(res.data.data);
					this.list = res.data.data
				}).catch((err) => {
					console.log(err);
				})
			},
			surebuy(){
				uni.navigateTo({
					url:"/pages/index/surebuy/surebuy"
				})
			},
			//分享
			share() {

			},
			//全部评论
			goallmsg() {
				uni.navigateTo({
					url: '/pages/index/allmsg/allmsg'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.all {
		.share{
			.top{
				font-size: 32rpx;
				font-weight: bold;
				color: #333333;
				padding: 15px;
				text-align: center;
				margin: 10px 0;
			}
			.center2{
				display: flex;
				align-items: center;
				margin: 20px 0;
				view{
					flex: 1;
					margin: 0 auto;
					text-align: center;
					
					font-size: 28rpx;
					font-weight: 500;
					color: #333333;
					image{
						width: 68rpx;
						height: 68rpx;
					}
				}
			}
			.lastbut{
				margin: 30px auto;
				width: 90%;
				background-color: #F9773A;
				padding: 10px 0;
				text-align: center;
				font-size: 30rpx;
				font-weight: bold;
				color: #FFFFFF;
				border-radius: 40px;
			}
		}
		.pop {
			padding: 15px;

			.top {
				padding: 10px 0;
				border-bottom: 1px solid #eeeeee;

				.img1 {
					width: 140rpx;
					height: 140rpx;
					margin-right: 10px;
				}

				.price {
					font-size: 32rpx;
					font-weight: bold;
					color: #333333;
					margin: 5px 0;
				}

				.num {
					margin: 5px 0;
					font-size: 26rpx;
					font-weight: 500;
					color: #666666;
				}
			}

			.center {
				.tit {
					font-size: 30rpx;
					font-weight: 500;
					color: #333333;
				}
			}

			.lists {
				flex-wrap: wrap;

				.list {
					padding: 5px 10px;
					background-color: #F5F5F5;
					margin: 5px;
					font-size: 28rpx;
					font-weight: 500;
					color: #777777;
				}
			}

			.buttom {
				text-align: center;
				padding: 10px 0;
				background: linear-gradient(#F9773A, #FF3B06);
				border-radius: 40px;
				color: #fff;
			}
		}

		.center {
			padding: 10px;

			.one {
				margin-bottom: 10px;
				display: flex;
				align-items: center;
				justify-content: space-between;


				.left {
					display: flex;
					align-items: center;

					.s1 {
						font-size: 26rpx;
						font-weight: 500;
						color: #333333;
					}

					.s2 {
						font-size: 34rpx;
						font-weight: bold;
						color: #FF3B06;
					}
				}

				.right {
					width: 44rpx;
					height: 44rpx;
				}
			}

			.two {
				font-size: 30rpx;
				font-weight: 500;
				color: #333333;
				margin-bottom: 10px;
			}

			.three {
				font-size: 28rpx;
				font-weight: 500;
				color: #777777;
			}

			.four {
				margin: 10px 0;
				width: 90%;
				background-color: #FFF4F1;
				border-radius: 10px;
				padding: 5px 10px;

				.top {
					display: flex;
					align-items: center;
					margin: 10px 0;
					font-size: 28rpx;
					font-weight: 500;
					color: #333333;

					view {
						flex: 1;
						text-align: center;
					}
				}
			}

			.solid {
				margin: 5px 0;
				width: 100%;
				height: 3px;
				background-color: #eeeeee;
			}

			.five {
				padding: 5px 10px;

				input {
					font-size: 28rpx;
					font-weight: 500;
					color: #777777;
				}

				.left {
					margin-right: 10px;
					font-size: 28rpx;
					font-weight: bold;
					color: #333333;
				}

				.right {
					width: 15rpx;
					height: 15px;
				}
			}

			.shopdetil {
				.top {
					font-size: 32rpx;
					font-weight: bold;
					color: #333333;
					margin-bottom: 10px;
				}

				.lists {
					flex-wrap: wrap;

					.list {
						margin: 5px;
						padding: 3px 10px;
						font-size: 26rpx;
						font-weight: 500;
						color: #777777;
						background: #F5F5F5;
						border-radius: 22rpx;
					}
				}

				.card {
					padding: 10px;
					border-bottom: 2px solid #cccccc;

					.img1 {
						width: 78rpx;
						height: 78rpx;
						margin-right: 10px;
					}

					.user {
						font-size: 28rpx;
						font-weight: 500;
						color: #333333;
					}

					.mesg {
						margin: 10px 0;
						font-size: 26rpx;
						font-weight: 500;
						color: #333333;
					}

					.guige {
						font-size: 26rpx;
						font-weight: 500;
						color: #333333;
					}

				}

				.allmsg {
					text-align: center;
					margin: 10px 0;
					font-size: 26rpx;
					font-weight: 500;
					color: #FF3B06;
				}
			}

			.detil {
				padding-bottom: 80px;

				.tit {
					font-size: 32rpx;
					font-weight: bold;
					color: #333333;
					margin: 10px 0;
				}

				image {
					margin: 10px 0;
					width: 100%;
					height: 360rpx;
				}
			}
		}

		.lastcard {
			width: 100%;
			box-sizing: border-box;
			padding: 0 10px;
			position: fixed;
			bottom: 0;
			padding: 10px 10px 30px 10px;
			background-color: #fff;
			display: flex;
			align-items: center;
			text-align: center;

			.left {
				flex: 1;
				font-size: 24rpx;
				font-weight: 500;
				color: #333333;

				.img1 {
					margin: 0 10px;
					width: 40rpx;
					height: 42rpx;
				}
			}

			.right {
				display: flex;
				align-items: center;
				flex: 1;

				.join {
					padding: 10px;
					font-size: 30rpx;
					font-weight: 500;
					color: #666666;
					background-color: #F8F5F5;
					border-radius: 20px 0 0 20px;
				}

				.buy {
					padding: 10px;
					font-size: 30rpx;
					font-weight: 500;
					color: #FFFFFF;
					background-color: #FF3B06;
					border-radius: 0 20px 20px 0;
				}
			}
		}
	}
</style>